package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.DrgsVersionManageDTO;
import com.dhcc.DRGsHosp.core.domain.DrgsVersionManage;

public class DrgsVersionManageAssembler {
	public static DrgsVersionManageDTO  toDTO(DrgsVersionManage  dvm){
		if (dvm == null) {
			return null;
		}
		DrgsVersionManageDTO result  = new DrgsVersionManageDTO();
		result.setVerCode(dvm.getVerCode());
		result.setVerDesc(dvm.getVerDesc());
		result.setIcd9Version(dvm.getIcd9Version());
		result.setIcd10Version(dvm.getIcd10Version());
		result.setRegionCode(dvm.getRegionCode());
		result.setAddDate(dvm.getAddDate());
 	    return result;
	 }
	
	public static List<DrgsVersionManageDTO> toDTOs(Collection<DrgsVersionManage>  dvms){
		if (dvms == null) {
			return null;
		}
		List<DrgsVersionManageDTO> results = new ArrayList<DrgsVersionManageDTO>();
		for (DrgsVersionManage each : dvms) {
			results.add(toDTO(each));
		}
		return results;
	}
	
	 public static DrgsVersionManage  toEntity(DrgsVersionManageDTO  dvmDTO){
	 	if (dvmDTO == null) {
			return null;
		}
	 	DrgsVersionManage result  = new DrgsVersionManage();
	 	result.setVerCode(dvmDTO.getVerCode());
		result.setVerDesc(dvmDTO.getVerDesc());
		result.setIcd9Version(dvmDTO.getIcd9Version());
		result.setIcd10Version(dvmDTO.getIcd10Version());
		result.setRegionCode(dvmDTO.getRegionCode());
		result.setAddDate(dvmDTO.getAddDate());
 	  	return result;
	 }
	
	public static List<DrgsVersionManage> toEntities(Collection<DrgsVersionManageDTO> dvmDTOs) {
		if (dvmDTOs == null) {
			return null;
		}
		
		List<DrgsVersionManage> results = new ArrayList<DrgsVersionManage>();
		for (DrgsVersionManageDTO each : dvmDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
